import {commGet, commPost, commPut} from "@utils/service/index.js";
/**
 * 获取运单跟踪信息
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getShippingTrack(data) {
    return commGet({
        url: `/tms/shippingTrack/list`,
        method: 'get',
        data
    })
}

/**
 * 获取海外仓列表
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getOverseaWarehouse(data) {
    return commGet({
        url: `/tms/shippingTrack/oversea/warehouse`,
        method: 'get',
        data
    })
}

/**
 * 编辑运单跟踪信息
 * @param data
 * @returns {Promise<unknown extends (null | undefined) ? unknown : (unknown extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : unknown)>}
 */
export function editShippingTrack(data) {
    return commPut({
        url: `/tms/shippingTrack/edit/base`,
        method: 'put',
        data
    })
}
export function editDetailShippingTrack(data) {
    return commPut({
        url: `/tms/shippingTrack/edit/truck`,
        method: 'put',
        data
    })
}
export function editDetailShippingTime(data) {
    return commPut({
        url: `/tms/shippingTrack/edit/time`,
        method: 'put',
        data
    })
}
export function addShippingTrack(data) {
    return commPost({
        url: `/tms/shippingTrack/add`,
        method: 'post',
        data
    })
}

/**
 * 获取运单详情
 * @param data
 * @returns {Promise<unknown extends (null | undefined) ? unknown : (unknown extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : unknown)>}
 */
export function getShippingDetail(data) {
    return commGet({
        url: `/tms/shippingTrack/detail/truck`,
        method: 'get',
        data
    })
}

/**
 *  获取运单信息
 * @param data
 * @returns {Promise<* extends (object & {then(onfulfilled: infer F, ...args: infer _): any}) ? (F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never) : *>}
 */
export function getShippingInfo(data) {
    return commGet({
        url: `/tms/shippingTrack/detail/info`,
        method: 'get',
        data
    })
}
export function getShippingTrackSkuList(data) {
    return commGet({
        url: `/tms/shippingTrack/detail/skuList`,
        method: 'get',
        data
    })
}
